﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>经纪人管理-用户及权限设置-用户列表</title>
 <#include "../common/Resources.ftl"/>
 <link
	href="http://192.168.0.42/resource/greensystem/LigerUI/lib/ligerUI/skins/Aqua/css/ligerui-all.css"
	rel="stylesheet" type="text/css" />
<link
	href="http://192.168.0.42/resource/greensystem/LigerUI/lib/ligerUI/skins/ligerui-icons.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/scripts/common/ListUI.liger.js"></script>
<script type="text/javascript" src="${base}/scripts/plugin/jquery.form.js"></script>
<script type="text/javascript" src="${base}/scripts/plugin/ligerUI/js/ligerui.all.js"></script>
<script type="text/javascript" src="${base}/scripts/common/custom.js"></script>
<script type="text/javascript" src="${base}/scripts/module/manage/FunPermissionManager.js"></script>
</head>
<body>
			<div class="list_Content">
				 <div class="list-box">
            <div class="list-box-hd">
            
            	<div class="tool">
            	  <div class="fl"><a class="mini-button" href="${ctx}/funPermission/manager"><span class="mini-button-text">返回</span></a></div>
				  <div class="fr">
						<div class="breadCrumb">您的位置：<a href="${ctx}/funPermission/manager">组织及岗位授权</a> &gt; <span class="current">数据查看权限控制 </span></div>
					</div>
				</div>
			</div>
            <div class="list-box-bd">
                <!--tab -->
                <div class="tabs">
                    <ul class="fl">
                        <li><a href="${ctx}/funPermission/oAdd?controUnit=${controUnit!''}&displayName=${displayName}&orgId=${org.id}&positionId=${position.id}">模块级权限控制</a></li>
                        <li class="current"><a href="javascript:void(0);">数据查看权限控制</a></li>
                    </ul>
                  	<div class="fl" style="padding-left:15px; padding-top:5px">组织：${displayName} 岗位：${position.name}</div>
                </div>  	
                <!--//tab -->
                <div class="table-box">
                    <div class="table-hd"></div>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="dataTable">
                        <thead>
                            <tr>
                                <th scope="col">数据查看权限</th>
                                <th width="100">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left"><label id="dataName">${dataName!'个人'}</label></td>
                                <td align="center"><a href="javascript:void(0);" onclick="com.green.web.FunPermissionManager.selectOrg();" class="edit" id="edit" key="edit">编缉</a></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
			</div>
		 <input type="hidden"id="longNumber" value="${org.longNumber!''}"/>
         <input type="hidden"id="positionId" value="${position.id!''}"/>
</body>
<script>
	function selectOrg(obj){
		var orgList="";
		var orgListName="";
		for(var i=0;i<obj.length;i++){
			if(orgList=="")
			{
			 orgList=obj[i].id;
			 orgListName=obj[i].name;
			}else{
			 orgList=orgList+","+obj[i].id;
			 orgListName=orgListName+","+obj[i].name;
			}
		}
		
		$.ajax({
			type : "POST",
			url : ctx + "/person/saveDataPermission",
			data : {
				"positionId" : $("#positionId").val(),
				"orgList" : orgList
			},
			success : function(date) {
				var ss = $.trim(date.message);
				if (ss == 1 || ss == "1") {
					if(orgListName==""){
						orgListName="个人";
					}
					$('#dataName').text(orgListName);
					art.dialog.optTips('您的操作已经成功', 3, "success");
				} else {
					art.dialog.optTips('操作失败，请稍后再试', 3, "failure");
				}
			}
		});
	}
</script>
</html>
